﻿@{
    Layout = null;
}
@model IEnumerable<Weixin.MP.UI.WeixinMenu>
<style>
    .board
    {
        background: url("/Content/themes/default/images/tree_left_long.jpg") no-repeat scroll 0 0 transparent;
        padding-left: 55px;
    }
    TABLE.listMenu
    {
        border-top: #d3d3d3 1px solid;
        margin-top: 5px;
        width: 100%;
        margin-bottom: 5px;
        _border-collapse: collapse;
    }
    TABLE.listMenu THEAD TH
    {
        border-bottom: #d3d3d3 1px solid;
        padding-bottom: 5px;
        background-color: #f1f1f1;
        padding-left: 5px;
        padding-right: 5px;
        color: #666;
        font-size: 14px;
        border-top: #e3e3e3 1px solid;
        font-weight: normal;
        border-right: #ddd 1px solid;
        padding-top: 5px;
        color: #000000;
        font-weight: bold;
    }
    TABLE.listMenu TBODY TD
    {
        border-bottom: #eee 1px solid;
        padding-bottom: 10px;
        padding-left: 5px;
        padding-right: 5px;
        border-right: #eee 1px solid;
        padding-top: 10px;
        font-size: 12px;
        _empty-cells: show;
        word-break: break-all;
    }
    TABLE.listMenu TBODY TR:nth-child(2n+1)
    {
        background-color: #FCFCFC;
    }
    TABLE.listMenu TBODY TR:hover
    {
        background-color: #F1FCEA;
    }
    TABLE.listMenu TBODY TD p
    {
        padding: 0;
        font-size: 12px;
        _empty-cells: show;
        word-break: break-all;
    }
    TABLE.listMenu Tfoot TD
    {
        border-bottom: #eee 1px solid;
        padding-bottom: 10px;
        padding-left: 5px;
        padding-right: 5px;
        border-right: #eee 1px solid;
        padding-top: 10px;
        background-color: #f9f9f9;
        font-size: 12px;
        _empty-cells: show;
        word-break: break-all;
    }
    TABLE.listMenu THEAD TH.norightborder
    {
        border-right: 0;
    }
    TABLE.listMenu TBODY TD.norightborder
    {
        border-right: 0;
    }
    TABLE.listMenu .select
    {
        width: 30px;
    }
    TABLE.listMenu .keywords
    {
        width: 150px;
    }
    TABLE.listMenu .answer
    {
        width: 375px;
    }
    TABLE.listMenu .answer_text
    {
        width: 360px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        height: 16px;
    }
    .answer_text img
    {
        margin-right: 5px;
        float: left;
    }
    TABLE.listMenu .category
    {
        width: 70px;
    }
    TABLE.listMenu .time
    {
        width: 70px;
    }
    
    TABLE.listMenu .edit
    {
        width: 120px;
    }
    .top_explanation
    {
        border: 1px solid #DFC684;
        background: #F9EDBD;
        line-height: 22px;
        padding: 10px 15px;
        height: 90px;
        margin: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
</style>
<div class="pageHeader">
    <form onsubmit="return divSearch(this,'pagerList_ManageTeachers');" action="/teachers/TeacherPage.aspx"
    method="post">
    <div class="searchBar">
        <div class="top_explanation">
            1、一级菜单最多只能开启3个，一级菜单下的二级菜单最多只能开启5个；<br>
            2、自定菜单如果填的是链接地址时请以”http://”开头，且不能为空；<br>
            3、只有当布发之后才会同步到微信公众平台上；<br>
            4、创建自定义菜单后，由于微信客户端缓存，需要24小时微信客户端才会展现出来。建议测试时可以尝试先取消关注公众账号，然后再次关注，则可以看到创建后的效果。
        </div>
    </div>
    </form>
</div>
<div class="pageContent">
    <div class="panelBar">
        <ul class="toolBar">
            <li><a class="add" href="/Menu/Add" target="dialog" width="600" height="450" mask="true" rel="Menu_Add"><span>添加菜单</span></a> </li>
            <li><a class="edit" href="/Menu/Publish" target="ajaxTodo" title="确定要同步到微信平台？"><span>同步到微信平台</span></a> </li>
        </ul>
    </div>
    <table class="listMenu" width="100%" layouth="138">
        <thead>
            <tr>
                <th>
                </th>
                <th>
                    菜单名称
                </th>
                <th>
                    菜单类型
                </th>
                <th>
                    关联关键词
                </th>
                <th>
                    外链URL
                </th>
                <th>
                    操作
                </th>
            </tr>
        </thead>
        <tbody id="menu_buttons">
            @foreach (var menu in Model.Where(c => c.parentId == 0))
            {
                <tr  target="repId" rel="@menu.id">
                    <td>
                        <span></span>
                    </td>
                    <td>
                        <div>
                            <span>@menu.name</span>
                        </div>
                    </td>
                    <td>
                        <span>
                            @if (menu.type.ToLower() == "click")
                            {<text>点击事件</text>}
                            else
                            {<text>访问网页</text>}
                        </span>
                    </td>
                    <td>
                        <span>@menu.key</span>
                    </td>
                    <td>
                        <span>@menu.url</span>
                    </td>
                    <td>
                        <a class="edit" href="/Menu/Edit?id=@menu.id" target="dialog" mask="true" width="600" height="450" rel="Menu_Edit"><span>[修改]</span> </a>
                        <a class="delete" href="/Menu/Delete?id=@menu.id" target="ajaxTodo" title="确定要删除吗？"><span>[删除]</span> </a>
                    </td>
                </tr>
                            foreach (var submenu in Model.Where(w => w.parentId == @menu.id))
                            {
                <tr target="repId" rel="@submenu.id">
                    <td>
                        <span></span>
                    </td>
                    <td>
                        <div class="board">
                            <span>@submenu.name</span>
                        </div>
                    </td>
                    <td>
                        <span>
                            @if (submenu.type.ToLower() == "click")
                            {<text>点击事件</text>}
                            else
                            {<text>访问网页</text>}
                        </span>
                    </td>
                    <td>
                        <span>@submenu.key</span>
                    </td>
                    <td>
                        <span>@submenu.url</span>
                    </td>
                    <td>
                        <a class="edit" href="/Menu/Edit?id=@submenu.id" target="dialog" mask="true" width="600" height="450" rel="Menu_Edit">
                            <span>[修改]</span> </a><a class="delete" href="/Menu/Delete?id=@submenu.id" target="ajaxTodo" title="确定要删除吗?"><span>
                                [删除]</span> </a>
                    </td>
                </tr>
                            }
            }
        </tbody>
    </table>
</div>
